<?php get_header(); ?>
	
	<?php
		$printUrl = esc_url( get_permalink( get_page_by_title( 'Print' ) ) );
		$printParams = array( 'printPostId' => get_the_ID() );
		$printUrl = add_query_arg( $printParams, $printUrl );
	?>
	
	<div id="container">	
		<div id="content">
		
		<div id="alerts" class="hide">
			<div class="alert box-shadow-small">
				<div class="alert-content">
					eSfaturi.ro este un site unde te informezi inainte sa mergi in magazin pentru a cumpara un produs electrocasnic, electronic sau IT. eSfaturi nu vinde produse, eSfaturi iti arata care sunt caracteristicile care conteaza cu adevarat la un produs.
					<a href="<?php echo esc_url( get_permalink( get_page_by_title( 'Despre noi' ) ) ); ?>">Vezi detalii</a>
				</div>
				<button id="alert-close" type="button">Close</button>
			</div>
		</div>
		
<?php the_post(); ?>
			<div id="post-<?php the_ID(); ?>" <?php post_class('box-shadow-big'); ?>>
				<div id="entry-title">
					<h1 class="entry-title"><?php the_title(); ?></h1>
				</div>
				<div class="entry-meta">
					<span class="meta-prep meta-prep-entry-date"><img src="<?php bloginfo('template_directory'); ?>/styles/images/calendar-childish.png" alt="Calendar" /></span>
					<span class="entry-date"><abbr class="modified" title="<?php the_modified_time('Y-m-d\TH:i:sO') ?>"><?php the_modified_time( get_option( 'date_format' ) ); ?></abbr></span>
					<span class="meta-sep"> | </span>
					<span class="meta-prep meta-prep-entry-comments"><img src="<?php bloginfo('template_directory'); ?>/styles/images/comments-childish.png" alt="Comentarii" /></span>
					<span class="entry-comments" title="Lasa un comentariu"><?php comments_number("0 comentarii", "1 comentariu", "% comentarii" ); ?></span>
					<span class="meta-sep"> | </span>
					<span class="entry-categories">Categorie: <?php custom_post_categories(get_the_ID()); // function defined in functions.php file ?></span>
					<?php edit_post_link( __( 'Edit', 'shape' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t" ) ?>
				</div><!-- .entry-meta -->
					
				<div class="entry-content">
					<div style="overflow:hidden;float:left;">
						<?php
							$largeImageUrl = wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()), 'large');
						?>
						<a href="<?php echo $largeImageUrl[0]; ?>" title="<?php the_title(); ?>" class="fancybox" >
							<?php the_post_thumbnail('thumb270x270', array('class' => 'alignleft')); ?>
						</a>
					</div>
					<div style="width: 356px;min-height:155px;overflow:hidden;">
						<h3 class="top-characteristics-title">Caracteristici</h3>
						<?php						  
						  $custom_fields = get_post_custom();
						  foreach ( $custom_fields as $key => $value )
						  {
							$keyt = trim($key);
							if ( '_' == $keyt{0} )
								continue;
							
							echo "<div class='mainTopCharacteristic'><a href='#".$value[0]."' title='$key'>".$key."</a></div>";
						  }
						?>
					</div>
					<div class="shareTools">						
						<h3 class="top-characteristics-title">Da mai departe</h3>
						<div class="shareToolsContainer">							
							<div class="divPlusOne">
								<g:plusone size="medium"></g:plusone>
							</div>
							<div class="divTweet">
								<a href="https://twitter.com/share" class="twitter-share-button" data-via="esfaturi" data-related="esfaturi">Tweet</a>
							</div>
							<div class="divLikeSend">
								<fb:like send="true" layout="button_count" width="450" show_faces="false"></fb:like>
							</div>							
							<a href="<?php echo $printUrl; ?>" title="Printeaza articolul" class="share-print"><img src="<?php bloginfo('template_directory'); ?>/styles/images/print.png" alt="Print" /></a>
							<a href="#send-by-email-form" title="Trimite pe mail" class="share-email"><img src="<?php bloginfo('template_directory'); ?>/styles/images/mail.png" alt="Email" /></a>
						</div>
					</div>
					<div class="clearBoth" style="height:20px;"></div>
					<?php the_content(); ?>
				</div><!-- .entry-content -->
					
				<div class="entry-utility" style="margin-top:40px;overflow:hidden;">
					<div class="shareTools">
						<div class="shareToolsContainer">							
							<div class="divPlusOne">
								<g:plusone size="medium"></g:plusone>
							</div>
							<div class="divTweet">
								<a href="https://twitter.com/share" class="twitter-share-button" data-via="esfaturi" data-related="esfaturi">Tweet</a>
							</div>
							<div class="divLikeSend">
								<fb:like send="true" layout="button_count" width="450" show_faces="false"></fb:like>
							</div>							
							<a href="<?php echo $printUrl; ?>" title="Printeaza articolul" class="share-print"><img src="<?php bloginfo('template_directory'); ?>/styles/images/print.png" alt="Print" /></a>
							<a href="#send-by-email-form" title="Trimite pe mail" class="share-email"><img src="<?php bloginfo('template_directory'); ?>/styles/images/mail.png" alt="Email" /></a>
						</div>
					</div>
					<a href="#wrapper" class="scrollTop right bottomScrollTop">Sus</a>
					<div class="clearBoth"></div>
				</div><!-- .entry-utility -->													
			</div><!-- #post-<?php the_ID(); ?> -->					

			<?php comments_template('', true); ?>			
			
		</div><!-- #content -->		
	</div><!-- #container -->
		
	<!--Send by email form (is hidden)-->
	<div class="hide">
		<div id="send-by-email-form">
			<h3 class="top-characteristics-title">Trimite articolul pe email</h3>
			<input type="hidden" value="<?php the_permalink( get_the_ID() ); ?>" id="hdnPostUrl" />
			<p>
				<label for="sbeTxtName">Nume: </label>
				<input type="text" id="sbeTxtName" name="sbeTxtName" />
			</p>
			<p>
				<label for="sbeTxtEmailAddress">Email: </label>
				<input type="text" id="sbeTxtEmailAddress" name="sbeTxtEmailAddress" />
			</p>
			<p class="sbeBtnSendByEmail">
				<input type="submit" value="Trimite pe email" class="yellowButton" id="sbeBtnSendByEmail" />
				<img src="<?php bloginfo('template_directory'); ?>/styles/images/loader.gif" class="hide" alt="Loading..." id="sbeImgLoader" />
			</p>
		</div>
	</div>
	<!--End of send by email form-->
	
<?php get_sidebar(); ?>	
<?php get_footer(); ?>